home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1992 January / 64er_Magazin_92-01_1992_Markt__Technik_de_Side_A.d64 / fraktale berge (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  1KB  |  21 lines

  1. 1 poke53281,0:print"[147] fraktale berge [146]":print"[156]von alex mayrhofer.":g=53272
  2. 2 poke53280,0:input"max. hoehe (32-80)";h:ifh<32orh>80then print"[145]";:goto 2
  3. 3 fori=1to4:print"hoehe"i":";-h;"bis"h;:inputh(i):h(i)=h(i)+128:nexti:h=h+128
  4. 4 input"faktor (0-1):";k:fori=16500to20724:pokei,255:next:poke16500,h(1):ep=0
  5. 5 poke16564,h(2):poke20660,h(3):poke20724,h(4):print"berechnungsbeginn"
  6. 6 fori=6to1step-1:s=2^i:fory=0to63steps:forx=0to63steps:ad=16500+x+y*65+s*33
  7. 7 j=s*33:z1=peek(ad-j):z2=peek(ad+j):j=j-s:z3=peek(ad-j):z4=peek(ad+j)
  8. 8 z=int((z1+z2+z3+z4)/4+rnd(1)*2*s+1-s)+1:ad(5)=ad-s*32.5:ad(6)=ad+s*32.5
  9. 9 print"[145]";int(ep)"[157]% ber.":ifabs(z-128)>(h-128)thenz=z-s/2*sgn(z-128)
  10. 10 z(5)=int((z1+z+z3)/3+k):z(6)=int((z4+z+z3)/3+k):z(7)=int((z3+z+z2)/3+k)
  11. 11 z(8)=int((z4+z+z1)/3+k):ep=ep+.07326:pokead,z:ad(7)=ad+s/2:ad(8)=ad-s/2
  12. 12 forq=5to8:c(q)=peek(ad(q)):ifc(q)<>255andc(q)<>0thenz(q)=(c(q)+z(q))/2
  13. 13 ifabs(z(q)-128)>(h-128)thenz(q)=z(q)-s/2*sgn(z(q)-128)
  14. 14 pokead(q),int(z(q)):nextq,x,y,i:poke53272,29:poke53265,59:poke53270,248
  15. 15 fori=0to999:poke1024+i,213:poke55296+i,102:next:fori=8192to16191:pokei,0
  16. 16 next:fory=0to64:forx=0to64:ad=16500+y*65+x:s=peek(ad):ifs<128thens=128
  17. 17 s=s-128:u=2*(x+y+13):ts=s-5*sgn(s):fort=tstos:v=y+90-t:b=int(u/8)*8:bt=6+b-u
  18. 18 a2=8192+(vand248)*39+b+v:d=2:w=t:p=peek(a2)and(255-3*2^bt):ifs=0thend=3:w=0
  19. 19 d=d-int((wand3)/3):pokea2,pord*2^bt:nextt,x,y:poke198,0:wait198,1:pokeg,21
  20. 20 poke53265,27:print"[147]p[207]43,0:p[207]44,32:p[207]45,0:p[207]46,64";:poke631,13:poke198,1
  21.